﻿// JavaScript Document

function ranub() { //随机验证码
		var nub=Math.floor(Math.random()*10000+1); //1-10000
		document.getElementById('nubs').innerHTML=nub;
		}

function bookmarkit(){ //加入收藏
window.external.addFavorite('http://www.foreveross.com','恒拓开源 www.foreveross.com')
}

function SetBg(obj) { //#9ECC00
	obj.style.borderColor='#63A242';
}
function FetBg(obj) {
	obj.style.borderColor='';
}

//if (document.getElementById){ 
//document.write('<style type="text/css">\n')
//document.write('.submenu{display: none;}\n')
//document.write('</style>\n')
//}

//菜单

function SwitchMenu(sid){
	
var which = document.getElementById("sub" + sid);
var imgmenu = document.getElementById("imgmenu" + sid);

	if (which.style.display == "none"){
		document.getElementById("sub" + sid).style.display="";
		imgmenu.className="menutitle2";
	}
	else{
		document.getElementById("sub" + sid).style.display="none";
		imgmenu.className="menutitle";
	}
}


var status = 1;
function switchSysBar(){
     if (1 == window.status){
		  window.status = 0;
          document.getElementById("switchPoint").innerHTML = '<img src="images/left.gif" alt="展开左栏" />';
          document.getElementById("frmTitle").style.display="none";
     }
     else{
		  window.status = 1;
          document.getElementById("switchPoint").innerHTML = '<img src="images/right.gif" alt="隐藏左栏" />';
          document.getElementById("frmTitle").style.display="block";
     }
}

		var hour = (new Date()).getHours();
		if (hour < 4) {
			hello = "夜深了，";
		}
		else if (hour < 7) {
			hello = "早安，";
		}
		else if (hour < 9) {
			hello = "早上好，"; 
		}
		else if (hour < 12) {
			hello = "上午好，";
		}
		else if (hour < 14) {
			hello = "中午好，";
		}
		else if (hour < 17) {
			hello = "下午好，";
		}
		else if (hour < 19) {
			hello = "您好，";
		}
		else if (hour < 22) {
			hello = "晚上好，";
		}
		else {
			hello = "夜深了，";
		}

var myweekday="";
mydate=new Date();
myweekday=mydate.getDay();

		if(myweekday == 0)
		weekday=" 星期日 ";
		else if(myweekday == 1)
		weekday=" 星期一 ";
		else if(myweekday == 2)
		weekday=" 星期二 ";
		else if(myweekday == 3)
		weekday=" 星期三 ";
		else if(myweekday == 4)
		weekday=" 星期四 ";
		else if(myweekday == 5)
		weekday=" 星期五 ";
		else if(myweekday == 6)
		weekday=" 星期六 ";


		function ShowMenu(obj,noid){
			var block =	document.getElementById(noid);
			var n = noid.substr(noid.length-1);
			//alert("id="+noid+"\n"+"n="+n+"\n"+"noid.length="+noid.length);
			if(noid.length==4){
				var ul = document.getElementById(noid.substring(0,3)).getElementsByTagName("ul");
				var h2 = document.getElementById(noid.substring(0,3)).getElementsByTagName("h2");
				for(var i=0; i<h2.length;i++){
					h2[i].innerHTML = h2[i].innerHTML.replace("-","+");
//					h2[i].style.color = "";
				}
//				obj.style.color = "#FF0000";
				//obj.className="menutile1";
				for(var i=0; i<ul.length; i++){if(i!=n){ul[i].className = "no";}}
			}else{
				var span = document.getElementById("menu").getElementsByTagName("span");
				var h1 = document.getElementById("menu").getElementsByTagName("h1");
				for(var i=0; i<h1.length;i++){
					h1[i].innerHTML = h1[i].innerHTML.replace("-","+");
					//h1[i].style.color = "";
				}
				obj.style.color = "#FFFFFF";
				//obj.className="menutitle2";
				for(var i=0; i<span.length; i++)
					{if(i!=n){span[i].className = "no";}}
			}
			if(block.className == "no"){
				block.className = "";
				//obj.className="menutitle2";
				obj.innerHTML = obj.innerHTML.replace("+","-");
				//alert(obj.innerHTML);
			}else{
				block.className = "no";
//				obj.style.color = "";
			}
		}

		function ShowMenuM(obj,noid){
			ShowMenu(obj,noid);
			var block =	document.getElementById(noid);
			if(block.className == "no"){
				obj.style.border = "";
				obj.style.color = "#CC66CC";
				obj.style.backgroundColor = "#FFCC66";
			}else {
				obj.style.border = "blue 1px thin";
				obj.style.color = "#FFFFFF";
				obj.style.backgroundColor = "#0066FF";
			}
		}

